<template>
    <div class="item" v-if="date"> <!--去拼团单项-->
        <div class="goods-review">{{date.buyer_number_text}}</div>
        <div class="goods-img"><img :src="date.image" :alt="date.medium_name"></div>
        <div class="goods-desc"><span class="get-itme">{{date.group_name_tag}}</span><span class="title">{{date.short_name}}</span></div>
        <div class="to-buy">
            <div class="price">
                <p class="ct-price">{{date.jumei_price}}</p>
                <p class="jm-price">{{date.single_price}}</p>
            </div>
            <div><van-button size="small">去开团</van-button></div>
        </div>
    </div>
</template>

<script>
export default {
    name: "item",
    props: {
        date: {
            type:Object,
            required: true,
            default: null
        }
    },
    methods: {

    },
    watch: {
        date(val){
            console.log(val)
        }
    }
}
</script>

<style scoped lang="scss">
.item{
    width: 100vw;
    position: relative;
    margin-bottom: 10px;
    background-color: #fff;
    .goods-review{
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        color: $color-v3;
        padding: 0 5px 0 10px;
        font-size: 12px;
        line-height: 24px;
        border-radius: 0 20px 20px 0;
        border: 1px solid $color-v4;
        background-color: $e-bcg;
        border-left: 0;
    }
    .goods-img{
        width: 100vw;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 5px 0;
        img{
            display: block;
            max-width: 100%;
            width: 128px;
            height: 128px;
        }
    }
    .goods-desc{
        margin-top: 3.2vw;
        padding: 0 3.2vw;
        font-size: 4vw;
        max-height: 7vw;
        overflow: hidden;
        .get-itme{
            color: $e-red;
            font-size: 4.5vw;
        }
    }
    .to-buy{
        display: flex;
        padding: 3.2vw;
        justify-content: space-between;
        align-items: flex-end;
        .price{
            .ct-price{
                color: $e-red;
                font-size: 6vw;
            }
            .jm-price{
                font-size: 3vw;
                color: $color-v3;
            }
        }
        .van-button{
            padding: 0 6vw;
            background-color: $e-red;
            color: #fff;
            border-radius: 6vw;
        }
    }
}
</style>
